<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增指标')"/>
    <th:block th:include="include :: datetimepicker-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-targetInfo-add" class="form-horizontal">
        <h4 class="form-header h4">指标基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标编号：</label>
                    <div class="col-sm-6">
                        <input name="targetNum" placeholder="请输入指标编号" class="form-control" type="text"
                               required>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标名称：</label>
                    <div class="col-sm-6">
                        <input name="targetName" placeholder="请输入指标名称" class="form-control" type="text"
                               required>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标类型：</label>
                    <div class="col-sm-6">
                        <select name="targetType" class="form-control m-b">
                            <option value="">请选择</option>
                            <option th:each="targetType : ${targetType}" th:text="${targetType.name}"
                                    th:value="${targetType.id}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标级别：</label>
                    <div class="col-sm-6">
                        <select name="targetLevel" class="form-control m-b">
                            <option value="">请选择</option>
                            <option th:each="targetLevel : ${targetLevel}" th:text="${targetLevel.name}"
                                    th:value="${targetLevel.id}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">版本号：</label>
                    <div class="col-sm-6">
                        <input name="version" type="text" placeholder="请输入版本号" class="form-control">
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">功能说明</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">公式：</label>
                    <div class="col-sm-6">
                        <input name="formula" placeholder="请输入公式" class="form-control" type="text">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标说明：</label>
                    <div class="col-sm-6">
                        <textarea name="targetExplain" maxlength="500" class="form-control"
                                  placeholder="请输入指标说明"></textarea>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标价值：</label>
                    <div class="col-sm-6">
                        <textarea name="targetWorth" maxlength="500" class="form-control"
                                  placeholder="请输入指标价值"></textarea>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">PDCA环</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标生产方：</label>
                    <div class="col-sm-6">
                        <select name="targetProducers" class="form-control m-b">
                            <option value="">请选择</option>
                            <option th:each="targetProducers : ${targetProducers}" th:text="${targetProducers.name}"
                                    th:value="${targetProducers.id}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标管理部门：</label>
                    <div class="col-sm-6">
                        <input name="targetManageDept" placeholder="请输入指标管理部门" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标管理方：</label>
                    <div class="col-sm-6">
                        <input name="targetManageName" type="text" placeholder="请输入指标管理方" class="form-control">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标指导部门：</label>
                    <div class="col-sm-6">
                        <input name="targetGuideDept" placeholder="请输入指标指导部门" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标指导方：</label>
                    <div class="col-sm-6">
                        <input name="targetgGuideName" type="text" placeholder="请输入指标指导方" class="form-control">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标开发部门：</label>
                    <div class="col-sm-6">
                        <input name="targetDevelopDept" placeholder="请输入指标开发部门" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-3 control-label">指标开发方：</label>
                    <div class="col-sm-6">
                        <input name="targetDevelopName" type="text" placeholder="请输入指标开发方" class="form-control">
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<div class="row">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存
        </button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭
        </button>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script>
    var prefix = ctx + "targetInfo";

    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-targetInfo-add").serializeArray();
            $.operate.saveTab(prefix + "/add", data);
        }
    }

</script>
</body>
</html>